package csc.daonjpa.java.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import csc.daonjpa.java.dao.CustomerDAO;
import csc.daonjpa.java.domain.Customer;

@Component
public class CustomerService {
	private CustomerDAO customerDAO;

	public CustomerDAO getCustomerDAO() {
		return customerDAO;
	}
	@Autowired
	public void setCustomerDAO(CustomerDAO customerDAO) {
		this.customerDAO = customerDAO;
	}

	public void addCustomer(Customer customer) {
		customerDAO.addCustomer(customer);
	}

	public List<Customer> getCustomers() {
		return customerDAO.getCustomers();
	}
	
	public Customer getCustomer(String loginId) {
		return customerDAO.getCustomer(loginId);
	}
	
	public Integer checkLogin(String id, String pass) {
		return customerDAO.checkLogin(id, pass);
	}
	
	public boolean updateCustomer(Customer customer) {
		return customerDAO.updateCustomer(customer);
	}
}
